package com.example.my.agiftthat.ui.classify.adapter;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.my.agiftthat.R;
import com.example.my.agiftthat.helper.BaseAdapterHelper;

import java.util.List;

/**
 * Created by My on 2016/10/13.
 */
public class SingleLeftBaseAdapter extends BaseAdapterHelper<String> {
    public SingleLeftBaseAdapter(Context context, List<String> list) {
        super(context, list);
    }

    @Override
    public View getItemView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.item_singleleft, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        //给ViewHolder中的属性赋值
        holder.textView_left.setText(mList.get(position));
        return convertView;
    }

    class ViewHolder {
        TextView textView_left;

        public ViewHolder(View view) {
            textView_left = (TextView) view.findViewById(R.id.textView_left);
        }
    }
}
